<?php
namespace app\modules\system\actions;

use app\lib\ActionBase;
use app\service\data as data;
use app\lib\Code;

class Config extends ActionBase {
    
    private $_config_data;
    
    //名称
    public $name;
    
    //富文本信息
    public $value;
    
    
    public function __construct() {
        $this->_config_data= new data\Config();
    }
    
    public function rules() {
        return [
            //编辑页脚
            ['name','required','on'=>'editfooter', 'message'=>'名称不能为空'],
            ['value','required','on'=>'editfooter', 'message'=>'富文本信息不能为空'],
            
        ];
    }
    
    
    //编辑页脚
    public function EditFooter($arrInput) {
        $this->setScenario("editfooter");
        $this->load($arrInput,'');
        if (!$this->validate()) {
            formatJson(Code::PARAM, $this->parseErrors2str($this->firstErrors));
        }
        $save = $this->_config_data->EditFooter($arrInput);
        if (! $save) {
            formatJson(Code::PARAM, "操作失败");
        }
        return $save;
    }
    

    
}